this.credit = 0; //@pausable do { //@nonblockable accept(nickel:NickelSignal); //@nonblockable accept(dime:DimeSignal); //@nonblockable accept(gum:GumSignal); if (nickel != null) nickelAmount = 5; else nickelAmount = 0; if (dime != null) dimeAmount = 10; else dimeAmount = 0; if (gum != null) gumAmount = -15; else gumAmount = 0; this.credit = this.credit + nickelAmount + dimeAmount + gumAmount; this.gumDispatcher.ReceptionCredit( new Credit( credit => this.credit ) ); } while(true);